package gui;

import java.awt.event.MouseEvent;

public class GameListener {

	public static MouseCentor mouse = new MouseCentor();
	
	public static MouseOval oval = new MouseOval();
	
	/**
	 * 鼠标按键
	 */
	public int button; 
	
	public class MouseAdapter{
		/**
		 * 按下
		 */
		public void mousePressed(MouseEvent e) {
			button = e.getButton();
			switch (button) {
			case 1:
				mouse.p1.setLocation(e.getPoint());
				mouse.p2.setLocation(e.getPoint());
				break;
			case 3:
				
				break;

			default:
				break;
			}
		}

		/**
		 * 抬起
		 */
		public void mouseReleased(MouseEvent e) {
			int button = e.getButton();
			switch (button) {
			case 1:
				mouse.clear();
				break;
			case 3:
				oval.p3.setLocation(e.getPoint());
				oval.setInitial();
				break;

			default:
				break;
			}
		}
	}
	
}
